﻿using System;
using System.Collections.Generic;
using System.Text;
using Cn.Cellula.Biz.Port;
using Cn.Cellula.Model;
using Cn.Cellula.Model.Content;

namespace Cn.Cellula.Biz.Impl {
    class NewslistBiz:MyBizSupport,INewslistBiz {
        #region INewsBiz 成员

        public void DeleteNews(IList<string> keys) {
            TNewsEO eo = null;
            foreach (String k in keys) {
                eo = base.Load<TNewsEO>(k);
                eo.FlgDel = 1;
                base.Update<TNewsEO>(eo);
            }
        }

        #endregion
        public IList<VGuestbookEO> LoadGuestbookView() {
            
            
            String hql = "from VGuestbookEO eo order by eo.LastDate desc";
            return base.Find<VGuestbookEO>(hql);
        
        
        }


        #region INewslistBiz 成员


        public void VerifyNews(IList<string> keys) {
            foreach (String k in keys) {
                TNewsEO eo = base.Load<TNewsEO>(k);
                eo.IsVerified = 1;
                base.Update<TNewsEO>(eo);
            }
        }

        public void SetTop(IList<string> keys) {
            foreach (String k in keys) {
                TNewsEO eo = base.Load<TNewsEO>(k);
                eo.FlgTop = 1;
                base.Update<TNewsEO>(eo);
            }
        }

        public void SetHeadline(IList<string> keys) {
            foreach (String k in keys) {
                TNewsEO eo = base.Load<TNewsEO>(k);
                eo.FlgHeadline = 1;
                base.Update<TNewsEO>(eo);
            }
        }

        #endregion
    }
}
